package 面向对象;

import java.util.Scanner;

//输出字符串，统计字符串中大写、小写字母和数字的个数
public class test1 {
    public static void main(String[] args) {
        Scanner sc =new Scanner (System.in);
        System.out.println("请输入一个字符串");
        String a = sc.next();

        int bigcount = 0;
        int smallcount = 0;
        int mathcount = 0;
        for(int i = 0 ; i < a.length() ; i++){
            char b = a.charAt(i);
            System.out.println(b);
            if(b >= 'a' && b <= 'z'){
                smallcount++;
            }else if(b >= 'A'&& b <= 'Z'){
                bigcount++;
            }else if(b >='0' && b<='9'){
                mathcount++;
            }
        }
        System.out.println("大写字母有："+bigcount);
        System.out.println("小写字母有："+smallcount);
        System.out.println("数字字符有： "+mathcount);
    }
}
